<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use backend\utils\XHtml;

/* @var $this yii\web\View */

$this->title = '新建JS';
$this->params['breadcrumbs'][] = ['label' => '资源管理', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => 'JS管理', 'url' => ['js']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="page-create">
    <div class="box box-primary">
        <div class="box-body">

            <?php $form = ActiveForm::begin(['options' => ['class' => 'form-horizontal']]); ?>

            <?= Html::beginTag('div', ['class' => 'form-group']) ?>
            <?= Html::beginTag('div', ['class' => 'col-lg-12']) ?>
            <?php if (!$name) { ?>
                <h3>
                    <div>文件名：<?= Html::textInput('name', '', ['required' => 'required']) ?>
                        <label>只能是英文字母和英文下横线，如：fun</label>
                    </div>
                </h3>
            <?php } ?>
            <?= Html::textarea('contents', $contents, ['class' => 'form-control', 'rows' => 35]) ?>
            <h3 class="text-center">
                <?= Html::label('保存前请务必自己做好备份', null, ['style' => 'color:red']) ?>
                <?= XHtml::submitButton('保存') ?>&nbsp;&nbsp;
                <?= XHtml::backButton() ?>&nbsp;&nbsp;
                <?= XHtml::resetButton() ?>
            </h3>
            <?= Html::endTag('div') ?>
            <?= Html::endTag('div') ?>

            <?php ActiveForm::end(); ?>
        </div>
    </div>
</div>